﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Timers;

using System.Xml.Serialization;
using NativeWifi;

namespace Example_Application
{
    class Program
    {
        static Timer tTimer;
        static Wardriver.Wardriver wdriv;

        static void Main(string[] args)
        {
            wdriv = new Wardriver.Wardriver();

            tTimer = new Timer();
            tTimer.Interval = 2000;
            tTimer.Elapsed += new ElapsedEventHandler(tTimer_Elapsed);
            tTimer.Start();

            wdriv.StartTimer();

            Console.ReadLine();
        }

        static void tTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            Console.Clear();
            List<Wardriver.WifiAP> _data = wdriv.GetWifiAP();
            Console.WriteLine("Wifi Data - Access Points: {0}", _data.Count);

            foreach (Wardriver.WifiAP item in _data)
            {
                Console.WriteLine("Access Point: {0} ({1})", item.SSID, item.MAC_String);

                List<Wardriver.WifiEntry> points = item.GetDataPoints();

                Console.WriteLine("Data Points: {0}", points.Count);

            }
        }
    }
}
